package com.shang.exception;

import com.shang.utils.ShangJSONResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.multipart.MaxUploadSizeExceededException;

@RestControllerAdvice
public class CustomExceptionHandler {

    @ExceptionHandler(MaxUploadSizeExceededException.class)
    public ShangJSONResult handlerMaxUploadFile(MaxUploadSizeExceededException ex){
        return ShangJSONResult.errorMsg("文件过大");
    }

}
